package com.mscsoft.brainpower.server.action;

import javax.annotation.Resource;

import com.mscsoft.brainpower.server.domain.*;
import com.mscsoft.brainpower.server.service.DownloadService;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DownloadAction {
    @Resource
    DownloadService downloadService;

    @RequestMapping("/download/msc")
    public Msg<GameFile> downloadMusicScore(String name) {
        return downloadService.download(name, FileType.MusicScore);
    }

    @RequestMapping("/download/ms")
    public Msg<GameFile> downloadMusic(String name) {
        return downloadService.download(name, FileType.Music);
    }

    @RequestMapping("/download/img")
    public Msg<GameFile> downloadImage(String name) {
        return downloadService.download(name, FileType.Image);
    }
}
